home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 26.zip
/
BS1 part 26
/
mediaphile disk 3.adf
/
ARexx
/
toast_uni.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1991-06-07
|
2KB
|
58 lines
/* toast_uni.rexx - a universal arexx script to send the command line */
/* argument to the switcher program */
TRUE = 1
FALSE = 0
NULL = ""
/* Parse the command line arguments */
parse arg arg1 arg2 arg3
/* Determine the number of passed arguments */
noargs = 3 /* Do not want more than 3 */
if arg3 = NULL then noargs = 2
if arg2 = NULL then noargs = 1
if arg1 = NULL then
do
SAY 'Need to pass a command line argument!'
exit
end
Switcher = 'ToasterARexx.port' /* address Switcher's ARexx port */
addlib(Switcher,0)
address command /* otherwise unknown commands goto DOS */
if show(port,Switcher) = FALSE /* if the Switcher is not around, */
then /* load it */
do
if arg(1) == "QUIT" /* If this is a QUIT command, don't */
then /* bother to load the switcher program */
do /* if it's not already in memory! */
say 'Switcher is not loaded!'
exit
end
say 'Loading switcher program...'
'Execute MP_ARexx:go_toast' /* Perform dos functions */
address 'ARexxWait.port' 'wait'
end
address /* disable DOS commands */
/* Make sure switcher program is activated (except for QUIT) */
if arg1 ~= "QUIT" then Switcher(TOSW)
/* Execute the command line argument (depends on no. of arguments)
For some reason, arg3 is always preceded by a space, so chop it off
if we need to */
if noargs = 1 then Switcher( arg1)
if noargs = 2 then Switcher( arg1, arg2)
if noargs = 3 then Switcher( arg1, arg2, RIGHT(arg3,(LENGTH(arg3)-1)) )
/* Put switcher program back to sleep (except for QUIT and TOSW) */
if (arg1 ~= "QUIT") & (arg1 ~= "TOSW") then Switcher(TOWB)
exit